import express from 'express';

const proxy = require('http-proxy-middleware').createProxyMiddleware;


const router = express.Router();
router.use('/', (req, res, next) => {
  req.headers.authorization = req.query.token as string;
  next();
}, proxy('/', {
  target: 'http://127.0.0.1:1024/',
  pathRewrite: {
    '/proxy': '/test',
  }
}));
module.exports = router;
